<template>
  <div>
    <Wangeditor v-model="content" :wangeditorConfig="wangeditorConfig"/>
    <button @click="submit">提交</button>
  </div>
</template>

<script>
import Wangeditor from "@/components/Wangeditor.vue";

export default {
  components: {
    Wangeditor,
  },
  data() {
    return {
      content: "",
      wangeditorConfig:{
        //高度
        height:500,
        //配置触发 onchange 的时间频率，默认为 200ms
        onchangeTimeout:500,
        //图片/视频上传地址
        uploadImgServer:'http://localhost:8080/titleFive/uploadImg',
        //图片参数名称
        uploadFileName: "myFileName",
        //图片大小
        uploadImgMaxSize: 5 * 1024 * 1024,
        //图片一次上传个数 多个图片后端需要做成数组或者集合
        uploadImgMaxLength: 1
      }
    };
  },
  methods: {
    submit() {
      console.log("---------------------");
      console.log(this.content);
      console.log("---------------------");
      // 此处可以提交到后端
    },
  },
};
</script>
